#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
<ui:composition  xmlns="http://www.w3.org/1999/xhtml"
                 xmlns:h="http://java.sun.com/jsf/html"
                 xmlns:f="http://java.sun.com/jsf/core"
                 xmlns:ui="http://java.sun.com/jsf/facelets"
                 xmlns:p="http://primefaces.org/ui"
                 template="/template/mainTemplate.xhtml"
                 xmlns:x="http://xpert.com/faces"
                 >
    <ui:param name="title" value="${symbol_pound}{msg['modeloEmail.list']}" />
    <ui:define name="body">
        <ui:include src="menuModeloEmail.xhtml" />
        <h:form id="formListModeloEmail">
            <x:modalMessages/>
            <x:dataTableActions target=":formListModeloEmail:dataTableModeloEmail" 
                                widgetVar="dataTableModeloEmailWidget" fileName="configuracaoEmail_export" />

            <p:dataTable paginator="true" rows="10" rowsPerPageTemplate="10,20,30" paginatorPosition="bottom" emptyMessage="${symbol_pound}{xmsg['noRecordFound']}"
                         var="modeloEmail" rowIndexVar="index" widgetVar="dataTableModeloEmailWidget"
                         styleClass="table-responsive" id="dataTableModeloEmail"
                         currentPageReportTemplate="${symbol_pound}{modeloEmailMB.dataModel.currentPageReportTemplate}"
                         paginatorTemplate="${symbol_pound}{modeloEmailMB.dataModel.paginatorTemplate}"
                         value="${symbol_pound}{modeloEmailMB.dataModel}" lazy="true" >
                <p:column styleClass="uix-datatable-index">
                    <h:outputText value="${symbol_pound}{index+1}"/>
                </p:column>
                <p:column headerText="${symbol_pound}{msg['modeloEmail.assunto']}" sortBy="${symbol_pound}{modeloEmail.assunto}"
                          filterBy="${symbol_pound}{modeloEmail.assunto}"   >
                    <f:facet name="header">
                        <h:outputText value="${symbol_pound}{msg['modeloEmail.assunto']}"/>
                    </f:facet>
                    <h:outputText value="${symbol_pound}{modeloEmail.assunto}"/>
                </p:column>

                <p:column headerText="${symbol_pound}{msg['modeloEmail.tipoAssuntoEmail']}" sortBy="${symbol_pound}{modeloEmail.tipoAssuntoEmail}"
                          filterBy="${symbol_pound}{modeloEmail.tipoAssuntoEmail}"  filterOptions="${symbol_pound}{findAllBean.getSelect(classMB.tipoAssuntoEmail)}" >
                    <f:facet name="header">
                        <h:outputText value="${symbol_pound}{msg['modeloEmail.tipoAssuntoEmail']}"/>
                    </f:facet>
                    <h:outputText value="${symbol_pound}{modeloEmail.tipoAssuntoEmail.descricao}"/>
                </p:column>
                <p:column headerText="${symbol_pound}{msg['modeloEmail.configuracaoEmail']}" sortBy="${symbol_pound}{modeloEmail.configuracaoEmail}"
                          filterBy="${symbol_pound}{modeloEmail.configuracaoEmail.id}" filterOptions="${symbol_pound}{findAllBean.getSelect(classMB.configuracaoEmail)}"   >
                    <f:facet name="header">
                        <h:outputText value="${symbol_pound}{msg['modeloEmail.configuracaoEmail']}"/>
                    </f:facet>
                    <h:outputText value="${symbol_pound}{modeloEmail.configuracaoEmail}"/>
                </p:column>
                <p:column styleClass="uix-datatable-actions" exportable="false">
                    <f:facet name="header">
                        <h:outputText value="${symbol_pound}{xmsg['actions']}"/>
                    </f:facet>
                    <p:commandButton oncomplete="PF('widgetModeloEmailDetail').show();"  icon="ui-icon-zoomin" 
                                     process="@form" update=":formDetailModeloEmail" title="${symbol_pound}{xmsg['detail']}" >
                        <f:setPropertyActionListener value="${symbol_pound}{modeloEmail}" target="${symbol_pound}{modeloEmailMB.entity}" />
                    </p:commandButton>
                    <x:securityArea rolesAllowed="modeloEmail.create">
                        <p:button icon="ui-icon-pencil" outcome="createModeloEmail" title="${symbol_pound}{xmsg['edit']}">
                            <f:param name="id" value="${symbol_pound}{modeloEmail.id}" />
                        </p:button>
                    </x:securityArea>
                    <x:securityArea rolesAllowed="modeloEmail.delete">
                        <p:commandButton icon="ui-icon-trash" title="${symbol_pound}{xmsg['delete']}" process="@form" update="@form" 
                                         action="${symbol_pound}{modeloEmailMB.delete}" >
                            <f:setPropertyActionListener value="${symbol_pound}{modeloEmail.id}" target="${symbol_pound}{modeloEmailMB.id}" />
                            <x:confirmation message="${symbol_pound}{xmsg['confirmDelete']} - ${symbol_pound}{modeloEmail}" />
                        </p:commandButton>
                    </x:securityArea>
                </p:column>
            </p:dataTable>
            <div class="uix-audit-delete">
                <x:securityArea rolesAllowed="modeloEmail.audit">
                    <x:auditDelete for="${symbol_pound}{modeloEmailMB.entityClass}"/>
                </x:securityArea>
            </div>
        </h:form>

        <p:dialog widgetVar="widgetModeloEmailDetail" header="${symbol_pound}{msg['modeloEmail.detail']}" appendTo="@(body)" modal="true" styleClass="uix-dialog-fluid">
            <ui:include src="detailModeloEmail.xhtml" />
        </p:dialog>
    </ui:define>
</ui:composition>